<div class="ui-portlet">
    <ol class="breadcrumb">
      <li class="active">课堂信息</li>
    </ol>
</div>           
<hr>

<a target="_blank" href="/admin/courses/batchaddmember/{{$id}}" class="btn btn-primary">增加人员</a>

<a target="_blank" href="/admin/course_msgs/add?course_id={{$id}}&creator={{$datainfo['Course']['speaker']}}" class="btn btn-primary">发布课堂消息</a>
<a target="_blank" href="/admin/course_msgs/list?course_id={{$id}}" class="btn btn-default">查看课堂消息列表</a>

{{if $datainfo['Course']['status'] == 1 }}
        <p class="alert alert-success">直播中。</p>
{{elseif $datainfo['Course']['status'] == 2 }}
        <p class="alert alert-warning">直播结束</p>
{{elseif $datainfo['Course']['status'] == 0  }}
        <p class="alert alert-info">未开始。</p>
{{/if}}

<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
  <li role="presentation" class="active"><a href="#CourseInfo" role="tab" data-toggle="tab">课堂信息</a></li>
  <li role="presentation"><a href="#CourseMember" role="tab" data-toggle="tab">课堂成员</a></li>
  <li role="presentation"><a href="#MoreInfo" role="tab" data-toggle="tab">更多信息</a></li>
</ul>

<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="CourseInfo">
    <div class="clearfix">
        <label class="col-sm-2" for="CourseName">课堂名称</label>
        <div class="col-sm-9 controls">
            {{$datainfo['Course']['name']}}
        </div>
    </div>
    
    <hr/>
    <div class="clearfix">
        <label class="col-sm-2" for="CourseName">更多描述</label>
        <div class="col-sm-9">
            {{$datainfo['Course']['content']}}
        </div>
    </div>

    <hr/>

     <div>
        
       </div>
   </div>
   <div role="tabpanel" class="tab-pane" id="CourseMember">
   	<p><br></p>
   <table>
   	<thead><tr><th>编号</th><th>头像</th><th>姓名</th><th>手机</th><th>角色编号</th><th>角色名</th><th>操作</th></tr></thead>
   	<portlet cache="no" list_tpl="inner" portlet="body"  model="User" limit="100" fields="User.*,CourseMember.*,Role.id,Role.name" info="joins[0][table]=Course_members&joins[0][alias]=CourseMember&joins[0][type]=inner&joins[0][conditions][]=CourseMember.user_id=User.id&joins[0][conditions][CourseMember.course_id]=$id&joins[1][table]=roles&joins[1][alias]=Role&joins[1][type]=left&joins[1][conditions][]=CourseMember.role_id=Role.id">
   		<tr><td>{{$item['id']}}</td><td>{{if $item['avatar']}}<img src="{{$item['avatar']}}" style="width:100px;height:100px;">{{/if}}</td><td>{{$item['username']}}</td><td>{{$item['mobile']}}</td><td>{{$item_all['CourseMember']['role_id']}}</td><td>{{$item_all['Role']['name']}}</td><td><a href="/admin/Course_members/edit/{{$item_all['CourseMember']['id']}}">编辑</a>&nbsp;<a href="/admin/courses/delete_member/{{$item_all['CourseMember']['course_id']}}/{{$item_all['CourseMember']['user_id']}}">删除</a></td></tr>
   	</portlet>
   </table>
   </div>
   <div role="tabpanel" class="tab-pane" id="MoreInfo">   
   	<p><br></p> 
       <?php echo array_to_table($datainfo); ?>
   </div>
</div>